package com.hera.base.service.impl;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.log4j.Logger;

import com.hera.base.service.BaseService;

public abstract class BaseServiceImpl implements BaseService {

	private static Logger log = Logger.getLogger(BaseServiceImpl.class);
	
	protected void escribirParametros(String metodo, Object... parametros) {
		try {
			if (parametros == null) {
				log.info(metodo + " sin parametros");
				return;
			}
			for (int i = 0; i < parametros.length; i++) {
				log.info(metodo + " parametro " + (i + 1) + "["
						+ BeanUtils.describe(parametros[i]) + "]");
			}
		} catch (Exception e) {
			log.error(e.getMessage(), e);
		}
	}
	
}
